package com.ruoyi.member.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.member.mapper.FamilyMapMapper;
import com.ruoyi.member.domain.FamilyMap;
import com.ruoyi.member.service.IFamilyMapService;

/**
 * 家庭成员和家庭关联中间Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class FamilyMapServiceImpl implements IFamilyMapService 
{
    @Autowired
    private FamilyMapMapper familyMapMapper;

    /**
     * 查询家庭成员和家庭关联中间
     * 
     * @param id 家庭成员和家庭关联中间主键
     * @return 家庭成员和家庭关联中间
     */
    @Override
    public FamilyMap selectFamilyMapById(Long id)
    {
        return familyMapMapper.selectFamilyMapById(id);
    }

    /**
     * 查询家庭成员和家庭关联中间列表
     * 
     * @param familyMap 家庭成员和家庭关联中间
     * @return 家庭成员和家庭关联中间
     */
    @Override
    public List<FamilyMap> selectFamilyMapList(FamilyMap familyMap)
    {
        return familyMapMapper.selectFamilyMapList(familyMap);
    }

    /**
     * 新增家庭成员和家庭关联中间
     * 
     * @param familyMap 家庭成员和家庭关联中间
     * @return 结果
     */
    @Override
    public int insertFamilyMap(FamilyMap familyMap)
    {
        familyMap.setCreateTime(DateUtils.getNowDate());
        return familyMapMapper.insertFamilyMap(familyMap);
    }

    /**
     * 修改家庭成员和家庭关联中间
     * 
     * @param familyMap 家庭成员和家庭关联中间
     * @return 结果
     */
    @Override
    public int updateFamilyMap(FamilyMap familyMap)
    {
        familyMap.setUpdateTime(DateUtils.getNowDate());
        return familyMapMapper.updateFamilyMap(familyMap);
    }

    /**
     * 批量删除家庭成员和家庭关联中间
     * 
     * @param ids 需要删除的家庭成员和家庭关联中间主键
     * @return 结果
     */
    @Override
    public int deleteFamilyMapByIds(Long[] ids)
    {
        return familyMapMapper.deleteFamilyMapByIds(ids);
    }

    /**
     * 删除家庭成员和家庭关联中间信息
     * 
     * @param id 家庭成员和家庭关联中间主键
     * @return 结果
     */
    @Override
    public int deleteFamilyMapById(Long id)
    {
        return familyMapMapper.deleteFamilyMapById(id);
    }
}
